package net.tensor.tensor.activiti.connector;

import org.activiti.api.process.model.IntegrationContext;
import org.activiti.api.process.runtime.connector.Connector;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.stereotype.Component;

import java.util.Map;


/**
 * @author Q
 */
@Component("Movies.getMovieDesc")
public class MoviesConnector implements Connector {
    private final Logger logger = LoggerFactory.getLogger(MoviesConnector.class);

    @Override
    public IntegrationContext apply(IntegrationContext integrationContext) {
        Map<String, Object> inBoundVariables = integrationContext.getInBoundVariables();
        logger.info("已有的参数: " + inBoundVariables);
        logger.info("设置新的参数 movieDesc");
        integrationContext.addOutBoundVariable("movieDesc", "这是李小龙的电影描述");
        return integrationContext;
    }
}
